import { createStore } from "vuex";
// import { reactive } from "vue";
//这里放置全局状态管理
// const state = reactive({
//   user: null,
// });

// const setUser = (user) => {
//   state.user = user;
// };

// const clearUser = () => {
//   state.user = null;
// };



export default createStore(
  // state,
  // setUser,
  // clearUser,

  {
    state: {
        searchWord: '',
        change: false,
    },

    //访问过滤，这里没有使用，可以对输出值进行控制
    getters: {
        getSearchWord(state) {
            return state.searchWord
        },

    },
    mutations: {
        setSearchWord(state, word) {
            state.searchWord = word
        },
        setChange(state, change) {
            state.change = change
        }
    }
}
)

